<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>用户登录</TITLE><LINK 
href="/public/stylesheets/Default.css" type=text/css rel=stylesheet><LINK 
href="/public/stylesheets/xtree.css" type=text/css rel=stylesheet><LINK 
href="/public/stylesheets/User_Login.css" type=text/css rel=stylesheet>

<script type="text/javascript" src="/public/javascripts/jquery-1.6.4.min.js"></script>
<link rel="stylesheet" href="/public/stylesheets/alert.css" type="text/css" />
<script type="text/javascript" src="/public/javascripts/adu.alert.js"></script>
<META http-equiv=Content-Type content="text/html; charset=UTF-8">
<META content="MSHTML 6.00.6000.16674" name=GENERATOR></HEAD>

 <style type="text/css">
		.code{
		background-image:url(code.jpg);
		font-family:Arial;
		font-style:italic;
		color:Red;
		border:0;
		padding:2px 3px;
		letter-spacing:3px;
		font-weight:bolder;
		}
		.unchanged {
		border:0;
		}
</style>

<BODY id=userlogin_body onload="createCode();">
<DIV></DIV>

<DIV id=user_login>
<DL>
  <DD id=user_top>
  <UL>
    <LI class=user_top_l></LI>
    <LI class=user_top_c></LI>
    <LI class=user_top_r></LI></UL>
  <DD id=user_main>
  <UL>
    <LI class=user_main_l></LI>
    <LI class=user_main_c>
    <DIV class=user_main_box>
    <UL>
      <LI class=user_main_text>用户名： </LI>
      <LI class=user_main_input><INPUT class=TxtUserNameCssClass id=TxtUserName 
      maxLength=20 name=TxtUserName> </LI></UL>
    <UL>
      <LI class=user_main_text>密 码： </LI>
      <LI class=user_main_input><INPUT class=TxtPasswordCssClass id=TxtPassword 
      type=password name=TxtPassword> </LI></UL>
    <UL style="display:none;">
      <LI class=user_main_text>验证码： </LI>
      <LI class=user_main_input><input type="text" readonly="true"  id="checkCode" class="code" style="width: 100px;height:25px;text-align:center;font-size:14px;" /><a onclick="createCode();" href="javascript:void(0);"> 看不清楚换一张？</a></LI></UL></DIV></LI>
    <LI class=user_main_r><INPUT class=IbtnEnterCssClass id=IbtnEnter 
    style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" 
    type=image src="/public/images/user_botton.gif" name=IbtnEnter> </LI></UL>
  <DD id=user_bottom>
  <UL>
    <LI class=user_bottom_l></LI>
    <LI class=user_bottom_c><SPAN style="MARGIN-TOP: 40px;display:none;">如果您尚未在本站注册为用户，请先点此 <A 
    href="http://www.huacker.com.cn">注册</A> 。</SPAN> </LI>
    <LI class=user_bottom_r></LI></UL></DD></DL></DIV><SPAN id=ValrUserName 
style="DISPLAY: none; COLOR: red"></SPAN><SPAN id=ValrPassword 
style="DISPLAY: none; COLOR: red"></SPAN><SPAN id=ValrValidateCode 
style="DISPLAY: none; COLOR: red"></SPAN>
<DIV id=ValidationSummary1 style="DISPLAY: none; COLOR: red"></DIV>

<DIV></DIV>
<script type="text/javascript">
				var code ; //在全局 定义验证码
				function createCode(){
					code = "";
					var codeLength = 4;//验证码的长度
					var checkCode = document.getElementById("checkCode");
					checkCode.value = "";
					
					var selectChar = new Array(2,3,4,5,6,7,8,9,'A','B','C','D','E','F','G','H','J','K','L','M','N','P','Q','R','S','T','U','V','W','X','Y','Z');
					
					for(var i=0;i<codeLength;i++) {
					   var charIndex = Math.floor(Math.random()*32);
					   code +=selectChar[charIndex];
					}
					if(code.length != codeLength){
					   createCode();
					}
					checkCode.value = code;
				}
				
					$("#subtb").click(function(){
		   			
			   			var inputCode = document.getElementById("input1").value.toUpperCase();
						
						if(inputCode.length <=0) {
						   aduAlert("验证码错误！","提示");
						   return false;
						}
						else if(inputCode != code ){
						   aduAlert("验证码错误！","提示");
						   createCode();
						   return false;
						}
		   		});
		   		
		   		$("#IbtnEnter").click(function(){
		   			var uname = $("#TxtUserName").val(); 
		   			var upass = $("#TxtPassword").val();
		   			if(uname == "" || upass == ""){
		   				aduAlert("用户名/密码不能为空！","提示");
		   				return false;
		   			}
		   			
		   			var listAction = #{jsAction @BgloginAction.blogin(':uname',':upass')/}; 
		   			$.getJSON(listAction({uname:$("#TxtUserName").val(),upass:$("#TxtPassword").val()}),function(data){
						if(data.state == 0){
	   						aduAlert("密码用户不匹配！","提示");
	   						return ;
	   					}
	   					if(data.state == 1){
							window.location.href="/admin";
	   					}
					});
					
					/*
		   			$.ajax({
		   				type:'post',
		   				url :'/controllers/BgloginAction.blogin',
		   				data:({"uname":$("#TxtUserName").val(),"upass":$("#TxtPassword").val()}),
		   				dataType:'html',
		   				success:function(ee){
		   					alert(ee.state);
		   					if(ee.state == "０"){
		   						aduAlert("密码用户不匹配！","提示");
		   						return ;
		   					}
		   					if(ee.state == "1"){
								//window.location.href="/controllers/BgloginAction.foradmin";
		   					}
		   				}
		   			});
		   			*/
		   		});
</script>
</FORM></BODY></HTML>
